package com.open.capacity.notice.provider.wechat.chain;

import javax.annotation.Resource;

import org.apache.commons.chain.impl.ChainBase;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import com.open.capacity.notice.provider.wechat.chain.command.SendWechatFileCommand;
import com.open.capacity.notice.provider.wechat.chain.command.SendWechatTextCommand;

/**
 * 二次分发请求，判断消息处理
 *
 */
@Component
public class WechatMessageChain extends ChainBase implements InitializingBean {

	@Resource
	private SendWechatTextCommand sendWechatTextCommand;

	@Resource
	private SendWechatFileCommand sendWechatFileCommand;

	@Override
	public void afterPropertiesSet() throws Exception {
		// 将请求处理者角色加入链中
		addCommand(sendWechatTextCommand);
		addCommand(sendWechatFileCommand);
	}

}
